{if $ad_info['ad_full']['status']}
<?php
unset($ad_info['ad_full']['list']['legnth']);
unset($ad_info['ad_full']['list']['length']);
?>
{loop $ad_info['ad_full']['list'] $index $item}
<div id="ad_open{$index}" class="ad_open" style="z-index: 9932;display: none; position: fixed; left: 50%; top: 50%; transform: translate(-50%,-50%); width: {$item['adsize']}%;">
    {if $item['adurl']}
    <a href="{$item['adurl']}">
        <img style="display: block;width: 100%;" src="{$item['adimg']}">
    </a>
    {else}
    <a href="#" onclick="ad_closead_screen({$index})" >
        <img style="display: block;width: 100%;" src="{$item['adimg']}">
    </a>
    {/if}

    <span class="ad_close" onclick="ad_closead_screen({$index})"></span>
</div>
{/loop}
<div id="ad_screen" onclick="ad_closead_screen({$index})">
</div>
<style type="text/css">
    #ad_screen { display:none; z-index:9930; position:fixed; left:0; top:0; width:100%; height:100%; background:rgba(0,0,0,0.8);}
    .ad_close { position:absolute; background:url({$_G['URL']['YX2020_CSS']}images/closebtn.png) center no-repeat; width:28px; height:28px; z-index:99999; background-size:100%; display:block; right:7px; top:-36px;}
</style>
<script type="text/javascript">
    let count = "{php echo count($ad_info['ad_full']['list']);}";
    if(count > 0){
        setTimeout(()=>{openad(0)}, 1000);
    }
    function openad(i) {
        $('#ad_screen').fadeIn();
        $('.ad_open').hide();
        $('.ad_open').eq(i).fadeIn();
        $('.ad_close').fadeIn();
    }
    function ad_closead_screen(i) {
        $('#ad_screen').fadeOut();
        $('.ad_open').fadeOut();
        $('.ad_close').fadeOut();
        if($('.ad_open').eq(i+1).length>0){
            setTimeout(()=>{openad(i+1)}, 3000);
        }
    }
</script>
{/if}
<!--后台未发现存在adshow为11的判断-->
{if $ad_info['adshow'] && $ad_info['adshow']==11}
<style type="text/css">
    .ad_close { position:absolute; background:url({$_G['URL']['YX2020_CSS']}images/closebtn.png) center no-repeat; width:28px; height:28px; z-index:99999; background-size:100%; display:block; left:2%; top:2%;}
</style>
<span class="ad_close"></span>
<div id="ad_open" style="z-index: 10;display: none; position: fixed; bottom: 55px;  width: 100%;" onclick="goto_pop_url()">
    <img style="display: block;width: 100%;" src="{$ad_info['adimg']}">
</div>
{/if}

{if $ad_info['ad_bottom']['status'] || $ad_info['friendnum']['status']}
<style type="text/css">
    /*.adRight {z-index:2;position:fixed;display: none; transition:all 0.5s; right:0; bottom:43%;}*/
    .adRight {z-index:2;position:fixed; transition:all 0.5s; right:0; bottom:43%;}

    .adRight img  {height:auto;width:{$ad_info['friendnum']['adsize']}px; }
     .adBottom {z-index:2;position:fixed; left: 50%; transform: translate(-50%,0%);display: none;bottom:57px; width:{$ad_info['ad_bottom']['adsize']}%;}


    {if $_G['companyname'] =='飞驰软件'}
    .adBottom {bottom:46px;}
    {elseif $system['ruanjian']==0}
    .adBottom {bottom:54px;}
    {elseif $system['ruanjian']==1}
    .adBottom {bottom:55px;}
    {/if}
    .adBottom img { width:100%;}
    .adRight.downScroll { transform: translate(50%,0); opacity:0.5;}
    .closeIcon { position:absolute; background:url({$_G['URL']['YX2020_CSS']}images/adclose.png) center no-repeat; width:25px; height:25px;
        background-size:100% auto; top:-27px; right:5px; opacity:0.8;}
</style>
{if $ad_info['ad_bottom']['status']}
    <div class="adBottom" id="ad_open">
        <span class="closeIcon"></span>
        {if !empty($ad_info['ad_bottom']['adurl'])}
        <a href="{$ad_info['ad_bottom']['adurl']}">
            <img  src="{$ad_info['ad_bottom']['adimg']}">
        </a>
        {else}
        <img src="{$ad_info['ad_bottom']['adimg']}">
        {/if}
    </div>
{/if}
{if $ad_info['friendnum']['status']}
    <div class="adRight" id="ad_open" onclick="goto_pop_url()">
        <img src="{$ad_info['friendnum']['adimg']}">
    </div>
{/if}

<script>
    var t = 0,
        b = 0,
        scooltime = 0;
    $(window).scroll(function(){
        t = $(this).scrollTop();
        var num = $(window).scrollTop();
        var scrollNum = document.body.scrollHeight/3
        if (scrollNum<1500){scrollNum = 1500;}
        if(num>scrollNum){
            $('.adBottom').fadeOut();
        }else{
            $('.adBottom').fadeIn();
        }
        if(b != t){
            $('.adRight').addClass('downScroll')
            clearTimeout(scooltime);
            scooltime = setTimeout(function(){
                $('.adRight').removeClass('downScroll');
            },1500)
        }
        b = t;
    })
    $('.closeIcon').click(function(){
        $('.adBottom').remove();
    })
    function goto_pop_url() {
        {if !empty($ad_info['friendnum']['adurl'])}
            window.location.href="{$ad_info['friendnum']['adurl']}";
        {/if}
    }
</script>
{/if}
<script type="text/javascript">
    // setTimeout(openad, 1000);
    // function openad() {
    //     $('#ad_open').fadeIn();
    // }
</script>